using System.IO;
using System.Linq;
using Isis.Model;

namespace Isis.Helpers.Impl
{
    public class FileDetailsHelper
    {
        public FileDetails[] ListApplicationFolderFiles()
        {
            var appFolder = new ApplicationFolder();
            FileInfo[] files = appFolder.ListFilesInFolder();

            return
                files.Select(
                    f => new FileDetails {LastWriteTime = f.LastWriteTime, Name = f.Name, SizeBytes = f.Length}).
                    ToArray();
        }
    }
}